// 服务器返回SKU相关ts类型

// 服务器返回全部SKU相关数据类型
export interface ResponseData {
  code: number
  message: string
  ok: boolean
}

// SKU数据的ts类型
export interface SkuData {
  id?: number | string
  spuId?: number | string
  price: number
  skuName: string
  skuDesc: string
  weight?: number
  tmId?: number | string
  category3Id?: number | string
  skuDefaultImg?: string
  isSale?: number
  skuImageList: SkuImg[]
  skuAttrValueList: SkuAttr[]
  skuSaleAttrValueList: SkuSale[]
}

// 数组：元素都是已有SKU数据类型
export type SkuRecords = SkuData[]

export interface SkuResponseData extends ResponseData {
  data: {
    records: SkuRecords
    total: number
    size: number
    current: number
    searchCount: boolean
    pages: number
  }
}

// SKUImg ts类型
export interface SkuImg {
  id: number
  skuId: number | string
  imgName: string
  imgUrl: string
  spuImgId: number | string
  isDefault: string
}

// SKU attr ts类型
export interface SkuAttr {
  id: number | string
  attrId: number | string
  valueId: number | string
  skuId: number | string
  attrName: string
  valueName: string
}

// SKU sale ts类型
export interface SkuSale {
  id: number | string
  skuId: number | string
  spuId: number | string
  saleAttrValueId: number | string
  saleAttrId: number | string
  saleAttrName: string
  saleAttrValueName: string
}

// 请求SKU详情返回接口 ts类型
export interface SkuINFOResponseData extends ResponseData {
  data: SkuData
}
